package com.spzx.test1.t4;
/*
    并非全力
*/

import lombok.SneakyThrows;
import org.apache.commons.lang3.RandomUtils;

import java.util.concurrent.TimeUnit;


public class Phon {
    @SneakyThrows
    public synchronized void call(){
        System.out.println(Thread.currentThread().getName() + "正在打电话");
        TimeUnit.SECONDS.sleep(RandomUtils.nextInt(1, 5));
        System.out.println(Thread.currentThread().getName() + "结束电话");
    }

    @SneakyThrows
    public synchronized void sendMsg()  {
        System.out.println(Thread.currentThread().getName() + "正在发短信");
        TimeUnit.SECONDS.sleep(RandomUtils.nextInt(1, 5));
        System.out.println(Thread.currentThread().getName() + "发完短信");
    }


}
